package com.novax.ex.activity.provider.common;

import com.alibaba.fastjson.JSON;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Set;

/**
 * @description:
 * @author: Wade
 * @date: 10/24/24 2:56 PM
 * @param:
 * @return:
 **/
public class BinlogUtils {
    public static List<LinkedHashMap<String, String>> getData(String msg, Set<String> binLogTypeSet,String tableName){
        Binlog binlog = JSON.parseObject(msg, Binlog.class);
        if (binLogTypeSet.contains(binlog.getType())) {
            if (binlog.getTable().equals(tableName)) {
                return binlog.getData();
            }
        }
        return null;
    }
}
